﻿Public Class frmLogin

    Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CenterToScreen()
    End Sub

    Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        Try
            Dim userDTO As NguoiDungDTO = UserBUS.LayTaiKhoan(txtUserName.Text, txtPassword.Text)
            Me.Tag = userDTO
            Me.DialogResult = DialogResult.OK
        Catch ex As Exception
            MessageBox.Show("Dang Nhap That Bai")
        End Try
        Me.Hide()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Close()
    End Sub
End Class